using ApprovalTests;
using ApprovalTests.Reporters;
using Microsoft.SmallBasic.Library;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace SmallBasicFun.Tests.Quiz
{
	[TestClass]
	
	public class BubbleQuizTest
	{
		private static Primitive action = 0;
		private static Primitive ball = 1;
		private static int calls;


		[TestMethod]
		public void TestQuiz()
		{
			SmallBasicFun.Quiz.StartBubbleQuizAt += question2;
			//Program.Delay(15000);
		
			ApprovalHelper.ApproveProgramWindow();
		}
		

		private static void move()
		{
			// that  calls BubbleQuiz.DoMovement()
			SmallBasicFun.Quiz.DoMovement();
			calls++;
			if (calls == 1)
			{
				Timer.Stop();
			}
		}

		private static void question2()
		{
			// Set the 1st action to 5
			action[1] = 5;
		}

		private static void question4()
		{
			//  Set the 2nd action to -6
			action[2] = -6;
		}

		private static void question3()
		{
			//  Have the timer call Move every 100 milliseconds
			calls = 0;
			Timer.Tick += move;
			Timer.Start(100);
		}

		private static void question5()
		{
			//Make the current ball be a yellow circle with a 11 pixel radius
			ShapeMaker.SetColorForNextShape("yellow");
			ball = ShapeMaker.CreateCircle(11);
		}
	}
}